/**
 * 去除重复
 */
const MySql = require('../mysql/mysql');

exports.RemoveRepeat = (database, test, callback) => {
    /**
     * 接收需要查询的数据库表、需要验重的字段名
     * 返回查询信息，数组为空说明没有重复，数组不为空说明存在重复字段
     */
    let sqllik = "select * from " + database + " where UserName=" + MySql.mysql.escape(test);
    MySql.Mysql(sqllik, {}, (err, reults, fields) => {
        if (err) throw err;
        callback(reults)
    })
}